﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


namespace my_utils
{
    public class TransformUtils
    {
        public static Quaternion RotateTransformByDirection(Transform trans, bool is_right_direction = true)
        {
            int rotate_y = is_right_direction ? 180 : 0;
            var old_rotation = trans.rotation;
            var new_rotation = new Quaternion(old_rotation.x, rotate_y, old_rotation.z, old_rotation.w);
            trans.rotation = new_rotation;
            return new_rotation;
        }
    }
}